package com.shuhe.timer;

import com.shuhe.JettyServer;
import com.shuhe.common.Tools;
import com.shuhe.domain.mxgc.TaskCron;
import org.apache.log4j.Logger;

import java.util.*;

public class MyTaskNew extends TimerTask {
    private static boolean isRunning = false;
    private static Logger logger = Logger.getLogger(TaskCron.class);


    public MyTaskNew() {
    }

    public void run() {
        Calendar cal = Calendar.getInstance();
        if (!isRunning) {
            if (true) {

                isRunning = true;
                logger.info("开始执行指定任务");
                new TaskCron();
                isRunning = false;
                logger.info("指定任务执行结束");
            }
        } else {
            logger.info("上一次任务执行还未结束");
        }
    }

}

